Skip to content

fix(autofix): Remove race condition with autofix:clean label on bootstrap PRs#220

Merged
stranske merged 1 commit intomainfrom
fix/autofix-clean-label-race
Dec 27, 2025
Merged

fix(autofix): Remove race condition with autofix:clean label on bootstrap PRs#220
stranske merged 1 commit intomainfrom
fix/autofix-clean-label-race

Conversation

@stranske
Copy link
Copy Markdown
Owner

@stranske stranske commented Dec 27, 2025

Automated Status Summary

Scope

  • Scope section missing from source issue.

Tasks

  • Tasks section missing from source issue.

Acceptance criteria

  • Acceptance criteria section missing from source issue.

Head SHA: 45051ac
Latest Runs: ⏳ queued — Gate
Required: gate: ⏳ queued

Workflow / Job Result Logs
Agents PR meta manager ❔ in progress View run
CI Autofix Loop ✅ success View run
Copilot code review ❔ in progress View run
Gate ⏳ queued View run
Health 40 Sweep ❔ in progress View run
Health 44 Gate Branch Protection ❔ in progress View run
Health 45 Agents Guard ✅ success View run
Health 50 Security Scan ❔ in progress View run
Maint 52 Validate Workflows ✅ success View run
PR 11 - Minimal invariant CI ✅ success View run
Selftest CI ❔ in progress View run

…trap PRs

When autofix found no changes, it would add the autofix:clean label.
This caused a race condition with Codex bootstrap PRs:

1. Bootstrap commit created (minimal code)
2. First autofix runs, finds 'no changes' → adds autofix:clean
3. Real code pushed with formatting issues
4. Second autofix runs in clean mode (due to label) → skips full fix

The fix: Don't add autofix:clean as an outcome label.
It should only be used as a trigger label (input).

Fixes #217
Copilot AI review requested due to automatic review settings December 27, 2025 22:54
@stranske stranske temporarily deployed to agent-high-privilege December 27, 2025 22:54 — with GitHub Actions Inactive
@agents-workflows-bot
Copy link
Copy Markdown
Contributor

⚠️ Action Required: Unable to determine source issue for PR #220. The PR title, branch name, or body must contain the issue number (e.g. #123, branch: issue-123, or the hidden marker ).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a race condition where the autofix:clean label was incorrectly added to PRs when autofix found no changes, causing subsequent autofix runs on bootstrap PRs to enter clean mode prematurely and skip fixing actual formatting issues.

  • Removed logic that added autofix:clean label when no changes were found
  • Added clarifying comment explaining that autofix:clean is a trigger, not an outcome
  • Updated "no changes" summary to show "(none)" instead of "autofix:clean" for labels

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown
Contributor

Automated Status Summary

Head SHA: 333cf3f
Latest Runs: ⏳ pending — Gate
Required contexts: Gate / gate, Health 45 Agents Guard / Enforce agents workflow protections
Required: core tests (3.11): ⏳ pending, core tests (3.12): ⏳ pending, docker smoke: ⏳ pending, gate: ⏳ pending

Workflow / Job Result Logs
(no jobs reported) ⏳ pending

Coverage Overview

  • Coverage history entries: 1

Coverage Trend

Metric Value
Current 77.97%
Baseline 0.00%
Delta +77.97%
Minimum 70.00%
Status ✅ Pass

Updated automatically; will refresh on subsequent CI/Docker completions.


Keepalive checklist

Scope

No scope information available

Tasks

  • No tasks defined

Acceptance criteria

  • No acceptance criteria defined

@stranske stranske merged commit 9bf3636 into main Dec 27, 2025
56 checks passed
@stranske stranske deleted the fix/autofix-clean-label-race branch December 27, 2025 22:56
@github-actions
Copy link
Copy Markdown
Contributor

🤖 Keepalive Loop Status

PR #220 | Agent: Codex | Iteration 0/5

Current State

Metric Value
Iteration progress [----------] 0/5
Action wait (missing-agent-label)
Gate success
Tasks 0/2 complete
Keepalive ❌ disabled
Autofix ❌ disabled

🔍 Failure Classification

| Error type | infrastructure |
| Error category | resource |
| Suggested recovery | Confirm the referenced resource exists (repo, PR, branch, workflow, or file). |

stranske pushed a commit that referenced this pull request Feb 23, 2026
The diagnostic block added in PR #1643 references PR_REF to show
unpushed commits, but PR_REF is only in the commit step's env block,
not the run step's.  Under set -euo pipefail the unbound variable
crashes the entire step, preventing Claude's output from being
captured and the commit step from running.  This is why PR #220's
Claude runs produced zero output despite the runner fixes being
present.

Fix: use ${PR_REF:-} to safely handle the missing variable.

Also add artifact upload step (mirrors reusable-codex-run.yml) so
Claude's session JSONL, output, and analysis files are preserved
for debugging even when the run fails.

https://claude.ai/code/session_012WnYCcttvFEY3FETnhVcNL
stranske pushed a commit that referenced this pull request Feb 24, 2026
…odex

The --output-file flag does not exist in the Claude CLI, causing it to
exit immediately with code 1 (unknown option). This was introduced in
PR #1643 and is the root cause of Claude runs failing on PR #220.

Changes to reusable-claude-run.yml:
- Remove invalid --output-file and --output-format stream-json flags
- Use shell redirect with tee for session logging + output capture
- Use PIPESTATUS[0] to capture Claude exit code through the pipe
- Rename session files from .jsonl to .log (Claude text != JSONL)
- Add agents/*.md bootstrap file exclusion (matches Codex pattern)
- Add cross-agent artifact exclusion (codex-session/analysis files)

Changes to reusable-codex-run.yml:
- Add cross-agent artifact exclusion for claude-* files so shared
  workspace artifacts don't leak into Codex commits

https://claude.ai/code/session_012WnYCcttvFEY3FETnhVcNL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants